package com.novax.ex.activity.task.executor.message;

import com.novax.ex.activity.infrastructure.entity.BeebUser;
import com.novax.ex.common.util.Snowflake;
import lombok.Data;
import lombok.val;

import java.math.BigDecimal;

@Data
public class FundsReleaseMessage {

    private Long userId;
    private BigDecimal amount;
    private String currency;
    private String symbol;
    private Long orderId;

    public static Builder Builder() {
        return new Builder();
    }

    public static class Builder {

        public FundsReleaseMessage buildWith(BeebUser beebUser, BigDecimal unlockAmountThisBatch) {
            val message = new FundsReleaseMessage();
            message.setUserId(beebUser.getUserId());
            message.setAmount(unlockAmountThisBatch);
            message.setCurrency("beeb");
            message.setSymbol("beeb");
            message.setOrderId(Snowflake.generateId());
            return message;
        }
    }
}
